package cn.ljy.uem.web.action.frontend.mobile.course;

import cn.ljy.authority.web.controller.backstage.BaseController;
import cn.ljy.common.model.result.ResponseData;
import cn.ljy.common.utils.page.Pagination;
import cn.ljy.uem.model.SchoolCourseSection;
import cn.ljy.uem.model.query.SchoolCourseResourceQuery;
import cn.ljy.uem.model.query.SchoolCourseSectionQuery;
import cn.ljy.uem.service.SchoolCourseResourceService;
import cn.ljy.uem.service.SchoolCourseSectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "移动端课程章节模块")
@RestController
@RequestMapping(value = "/api/mobile/schoolcoursesection")
public class SchoolCourseSectionMobileController extends BaseController {

    @Autowired
    private SchoolCourseSectionService schoolCourseSectionService;


    @ApiOperation(value = "课程章节")
    @GetMapping("/all")
//    @Override
    protected ResponseData query(SchoolCourseSectionQuery schoolCourseSectionQuery) {
        return  ResponseData.success(schoolCourseSectionService.findAll(schoolCourseSectionQuery));
    }


    @ApiOperation(value = "分页查询所有课程章节数据")
  @GetMapping("/query")
  public ResponseData getAllCourse(Integer page, Integer pageSize, SchoolCourseSectionQuery query){
      Pagination pagination = schoolCourseSectionService.findAll(page,pageSize,query);
      return ResponseData.success(pagination);
  }




}
